<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>通过class属性查找</title>
</head>
<body>
<div>
	<p class="fish">草鱼</p>
	<p class="fish">里鱼</p>
	<p class="fish">鲫鱼</p>
	<p class="fish">鲈鱼</p>
	<p class="fish">连鱼</p>
	<p class="fish">家鱼</p>
	<p class="fish">刀鱼</p>

</div>
<script type="text/javascript">
// 属性查找
var radios = document.getElementsByClassName('fish');
radios[2].style.color = 'red';
</script>
</body>
</html>